package com.zq.common.enums;

import com.zq.common.exception.dao.BaseErrorInfoInterface;

public enum BusinessEnum implements BaseErrorInfoInterface {
    // 数据操作错误定义
    SUCCESS("2000", "成功!"),
    BODY_NOT_MATCH("4000", "请求的数据格式不符!"),
    SIGNATURE_NOT_MATCH("4001", "请求的数字签名不匹配!"),
    NOT_FOUND("4004", "空！未找到该资源!"),
    INTERNAL_SERVER_ERROR("5000", "服务器内部错误!"),
    SERVER_BUSY("5003", "服务器正忙，请稍后再试!"),
    INVALID_PARAM("4002", "无效的参数!"),
    UNAUTHORIZED("4003", "未经授权!"),
    FORBIDDEN("4005", "禁止访问!"),
    METHOD_NOT_ALLOWED("4006", "不支持的请求方法!"),
    REQUEST_TIMEOUT("4007", "请求超时!"),
    CONFLICT("4008", "请求冲突!"),
    GONE("4009", "资源不可用!"),
    LENGTH_REQUIRED("4010", "需要内容长度!"),
    PRECONDITION_FAILED("4011", "先决条件失败!"),
    REQUEST_ENTITY_TOO_LARGE("4012", "请求实体太大!"),
    UNSUPPORTED_MEDIA_TYPE("4013", "不支持的媒体类型!"),
    REQUESTED_RANGE_NOT_SATISFIABLE("4014", "请求的范围无法满足!"),
    EXPECTATION_FAILED("4015", "期望失败!"),
    UNPROCESSABLE_ENTITY("4016", "无法处理的实体!"),
    LOCKED("4017", "已锁定!"),
    FAILED_DEPENDENCY("4018", "依赖失败!"),
    UPGRADE_REQUIRED("4019", "需要升级!"),
    PRECONDITION_REQUIRED("4020", "需要先决条件!"),
    TOO_MANY_REQUESTS("4021", "请求过多!"),
    REQUEST_HEADER_FIELDS_TOO_LARGE("4022", "请求头字段太大!"),
    UNAVAILABLE_FOR_LEGAL_REASONS("4023", "由于法律原因不可用!"),

    // 用户相关错误定义
    USER_NOT_FOUND("4100", "用户未找到!"),
    DUPLICATE_USERNAME("4101", "用户名已存在!"),
    DUPLICATE_EMAIL("4102", "邮箱已被注册!"),
    PASSWORD_TOO_WEAK("4103", "密码过于简单!"),
    INVALID_CREDENTIALS("4104", "无效的凭据!"),
    WX_USER_LOGIN_ERROR("4105", "微信登录异常，请联系管理员!"),
    LOGIN_ERROR("4106", "登陆失败"),


    // 活动相关错误定义

    ACTIVITY_NOT_FOUND("4200", "活动未找到!"),
    ACTIVITY_ALREADY_ENDED("4201", "活动已结束!"),
    INVALID_DATE_RANGE("4202", "无效的日期范围!"),
    NOW_ALREADY_ACTIVITY("4203", "今天已经参与了其他活动"),
    ACTIVITY_IS_JOIN_ERROR("4204", "已参加本活动了"),
    // 标签相关错误定义
    TAG_NOT_FOUND("4300", "标签未找到!"),
    DUPLICATE_TAG_NAME("4301", "标签名已存在!"),

    GROUP_ERROR_MAX("4301", "活动组已满员!"),

    // 数据库操作相关错误定义
    DB_CONNECTION_ERROR("4400", "数据库连接失败!"),
    DB_QUERY_ERROR("4401", "数据库查询失败!"),
    DB_INSERT_ERROR("4402", "数据库插入失败!"),
    DB_UPDATE_ERROR("4403", "数据库更新失败!"),
    DB_DELETE_ERROR("4404", "数据库删除失败!"),

    // 手机号登录相关错误定义
    PHONE_NUMBER_NOT_FOUND("4500", "手机号未找到!"),
    INVALID_VERIFICATION_CODE("4501", "无效的验证码!"),
    VERIFICATION_CODE_SUCCEED("4505", "登录成功"),
    VERIFICATION_CODE_EXPIRED("4502", "验证码已过期!"),
    SEND_PHONE_CODE_SUCCEED("4503", "发送验证码成功!"),
    SEND_PHONE_CODE_ERROR("4504", "发送验证码失败"),
    /**
     * 标签
     */
    TAG_GET_TAG_ERROR("4600", "获取标签错误"),
    TAG_UPDATE_TAG_ERROR("4601", "修改标签错误");

    /**
     * 错误码
     */
    private final String resultCode;
    /**
     * 错误描述
     */
    private final String resultMsg;

    BusinessEnum(String resultCode, String resultMsg) {
        this.resultCode = resultCode;
        this.resultMsg = resultMsg;
    }


    public String getResultCode() {
        return resultCode;
    }


    public String getResultMsg() {
        return resultMsg;
    }

}
